<template>
  <div class="box">
    <div class="header">
      <van-nav-bar title="订单" left-arrow @click-left="$router.back()" />
    </div>
    <div class="content">
   
      <van-contact-card
        type="edit"
        tel="13456789008"
        name="张三"
        label="北京市昌平区"
        @click="onEdit"
      />
      <van-button type="primary" @click="$router.push('/addressList')">选择地址</van-button>
    

   




      <van-swipe-cell v-for="item in store.myOrderList" :key="item.id">
        <van-card
          :num="item.count"
          :price="item.price"
          :title="item.title"
          :thumb="item.image"
        />
      </van-swipe-cell>
    </div>

    <van-submit-bar
      :price="store.totalPrice * 100"
      button-text="提交订单"
      @submit="onSubmit"
    />
  </div>
</template>

<script setup >
import { useCounterStore } from "@/stores/counter";
const store = useCounterStore();

  let obj = {
    id: new Date().getTime(),
    title: "NO" + new Date().getTime(),
    price: store.totalPrice,
    
  };

  store.addMyOrder({
    ...obj,
    status: 1,
    orderList: store.orderList,
  });


</script>
